package com.zang.blogz.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 异常日志
 * </p>
 *
 * @author 朵橙i
 * @since 2022-09-03
 */
@Getter
@Setter
@TableName("tb_exception_log")
@ApiModel(value = "ExceptionLog对象", description = "异常日志")
public class ExceptionLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("操作URL")
    @TableField("opt_url")
    private String optUrl;

    @ApiModelProperty("操作方法")
    @TableField("opt_method")
    private String optMethod;

    @ApiModelProperty("操作描述")
    @TableField("opt_desc")
    private String optDesc;

    @ApiModelProperty("请求参数")
    @TableField("request_param")
    private String requestParam;

    @ApiModelProperty("请求方式")
    @TableField("request_method")
    private String requestMethod;

    @ApiModelProperty("异常数据")
    @TableField("response_data")
    private String responseData;

    @ApiModelProperty("用户id")
    @TableField("user_id")
    private Integer userId;

    @ApiModelProperty("用户昵称")
    @TableField("nickname")
    private String nickname;

    @ApiModelProperty("操作者ip")
    @TableField("ip_address")
    private String ipAddress;

    @ApiModelProperty("操作地址")
    @TableField("ip_source")
    private String ipSource;

    @ApiModelProperty("异常发生时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date createTime;


}
